'use strict';

const RequestJsonApi = require('../lib/class/requestJsonApi');

module.exports = app => {
  // 定义参数 继承request类

  const host = app.config.apiServiceLocation.shop;
  const url = '/shops';
  const dataType = 'shops';

  const shops = new Shops({ host, url, dataType });

  return shops;
};

class Shops {
  constructor (options) {
    this.requestJsonApi = new RequestJsonApi(options);
  }

  async get (idList) {
    // { idList: [1, 3, 5, 6, 7] or 1}
    const data = await this.requestJsonApi.get({ idList });
    return data;
  }
}
